
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>


int main()
{
    printf("当前进程开始... %d\n",getpid());
    int id = fork();
    printf("%p --- %d\n",&id,id);

    if(id == 0)
        printf("我是一个子进程... %d\n",getpid());
    else if (id > 0)
        printf("我是一个父进程... %d\n",getpid());
    else
        return 1;

    printf("%p --- %d\n",&id,id);
    printf("\n");
    return 0;
}
